package net.mycrub.bitwise.ocr.training;

import net.mycrub.bitwise.core.Brain;

public class CoupleCandidate implements Comparable<CoupleCandidate> {
    private Brain mom;
    private Brain dad;
    private int perf;
    public Brain getMom() {
        return mom;
    }
    public void setMom(Brain mom) {
        this.mom = mom;
    }
    public Brain getDad() {
        return dad;
    }
    public void setDad(Brain dad) {
        this.dad = dad;
    }
    public int getPerf() {
        return perf;
    }
    public void setPerf(int perf) {
        this.perf = perf;
    }
    public int compareTo(CoupleCandidate o) {
        return o.perf - perf;
    }
    public CoupleCandidate(Brain mom, Brain dad, int perf) {
        super();
        this.mom = mom;
        this.dad = dad;
        this.perf = perf;
    }
    public int hashcode() {
        return mom.hashCode() * dad.hashCode();
    }
    public boolean equals(Object o) {
        return o instanceof CoupleCandidate 
            && ((CoupleCandidate)o).mom == mom 
            && ((CoupleCandidate)o).dad == dad; 
    }
}
